package cn.lyz.authority.system.controller;

import cn.lyz.authority.common.vo.LyzResponseBody;
import cn.lyz.authority.system.dto.LoginUserDTO;
import cn.lyz.authority.system.service.ISysLoginService;
import cn.lyz.authority.system.service.impl.SysLoginServiceImp;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Log4j2
@RestController
@RequestMapping("system")
public class SysAuthorityController {

    @Resource
    private ISysLoginService sysLoginService;

    @PostMapping("login")
    public LyzResponseBody<?> login(@RequestBody LoginUserDTO user){
        String token = sysLoginService.login(user);
        return LyzResponseBody.success().setData(token);
    }
}

